<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclimage.cpp -->
  <title>QCLImage2D Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLImage2D</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLImage2D Class Reference</h1>
<!-- $$$QCLImage2D-brief -->
<p>The QCLImage2D class represents a 2D OpenCL image object. <a href="#details">More...</a></p>
<!-- @@@QCLImage2D -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLImage2D&gt;</pre><p>Inherits <a href="qclmemoryobject.html">QCLMemoryObject</a>.</p>
<p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qclimage2d-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#QCLImage2D">QCLImage2D</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#QCLImage2D-2">QCLImage2D</a></b> ( QCLContext * <i>context</i>, cl_mem <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#QCLImage2D-3">QCLImage2D</a></b> ( const QCLImage2D &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#dtor.QCLImage2D">~QCLImage2D</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#bytesPerElement">bytesPerElement</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#bytesPerLine">bytesPerLine</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#copyTo">copyTo</a></b> ( const QRect &amp; <i>rect</i>, const QCLImage2D &amp; <i>dest</i>, const QPoint &amp; <i>destOffset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#copyTo-2">copyTo</a></b> ( const QRect &amp; <i>rect</i>, const QCLImage3D &amp; <i>dest</i>, const size_t[3] <i>destOffset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#copyTo-3">copyTo</a></b> ( const QRect &amp; <i>rect</i>, const QCLBuffer &amp; <i>dest</i>, size_t <i>destOffset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#copyToAsync">copyToAsync</a></b> ( const QRect &amp; <i>rect</i>, const QCLImage2D &amp; <i>dest</i>, const QPoint &amp; <i>destOffset</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#copyToAsync-2">copyToAsync</a></b> ( const QRect &amp; <i>rect</i>, const QCLImage3D &amp; <i>dest</i>, const size_t[3] <i>destOffset</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#copyToAsync-3">copyToAsync</a></b> ( const QRect &amp; <i>rect</i>, const QCLBuffer &amp; <i>dest</i>, size_t <i>destOffset</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#drawImage">drawImage</a></b> ( QPainter * <i>painter</i>, const QPoint &amp; <i>point</i>, const QRect &amp; <i>subRect</i> = QRect(), Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#drawImage-2">drawImage</a></b> ( QPainter * <i>painter</i>, const QRect &amp; <i>targetRect</i>, const QRect &amp; <i>subRect</i> = QRect(), Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImageFormat </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#format">format</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#height">height</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void * </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#map">map</a></b> ( const QRect &amp; <i>rect</i>, QCLMemoryObject::Access <i>access</i>, int * <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#mapAsync">mapAsync</a></b> ( void ** <i>ptr</i>, const QRect &amp; <i>rect</i>, QCLMemoryObject::Access <i>access</i>, const QCLEventList &amp; <i>after</i> = QCLEventList(), int * <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#read">read</a></b> ( void * <i>data</i>, const QRect &amp; <i>rect</i>, int <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#read-2">read</a></b> ( QImage * <i>image</i>, const QRect &amp; <i>rect</i> = QRect() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#readAsync">readAsync</a></b> ( void * <i>data</i>, const QRect &amp; <i>rect</i>, const QCLEventList &amp; <i>after</i> = QCLEventList(), int <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QImage </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#toQImage">toQImage</a></b> ( bool <i>cached</i> = true )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#width">width</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#write">write</a></b> ( const void * <i>data</i>, const QRect &amp; <i>rect</i>, int <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#write-2">write</a></b> ( const QImage &amp; <i>image</i>, const QRect &amp; <i>rect</i> = QRect() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#writeAsync">writeAsync</a></b> ( const void * <i>data</i>, const QRect &amp; <i>rect</i>, const QCLEventList &amp; <i>after</i> = QCLEventList(), int <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage2D &amp; </td><td class="memItemRight bottomAlign"><b><a href="qclimage2d.html#operator-eq">operator=</a></b> ( const QCLImage2D &amp; <i>other</i> )</td></tr>
</table>
<ul>
<li class="fn">11 public functions inherited from <a href="qclmemoryobject.html#public-functions">QCLMemoryObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QCLImage2D-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLImage2D class represents a 2D OpenCL image object.</p>
</div>
<!-- @@@QCLImage2D -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLImage2D[overload1]$$$QCLImage2D -->
<h3 class="fn"><a name="QCLImage2D"></a>QCLImage2D::QCLImage2D ()</h3>
<p>Constructs a null 2D OpenCL image object.</p>
<!-- @@@QCLImage2D -->
<!-- $$$QCLImage2D$$$QCLImage2DQCLContext*cl_mem -->
<h3 class="fn"><a name="QCLImage2D-2"></a>QCLImage2D::QCLImage2D ( <a href="qclcontext.html">QCLContext</a> * <i>context</i>, cl_mem <i>id</i> )</h3>
<p>Constructs a 2D OpenCL image object that is initialized with the native OpenCL identifier <i>id</i>, and associates it with <i>context</i>. This class will take over ownership of <i>id</i> and will release it in the destructor.</p>
<!-- @@@QCLImage2D -->
<!-- $$$QCLImage2D$$$QCLImage2DconstQCLImage2D& -->
<h3 class="fn"><a name="QCLImage2D-3"></a>QCLImage2D::QCLImage2D ( const QCLImage2D &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QCLImage2D -->
<!-- $$$~QCLImage2D[overload1]$$$~QCLImage2D -->
<h3 class="fn"><a name="dtor.QCLImage2D"></a>QCLImage2D::~QCLImage2D ()</h3>
<p>Destroys this 2D OpenCL image.</p>
<!-- @@@~QCLImage2D -->
<!-- $$$bytesPerElement[overload1]$$$bytesPerElement -->
<h3 class="fn"><a name="bytesPerElement"></a>int QCLImage2D::bytesPerElement () const</h3>
<p>Returns the number of bytes per element in this OpenCL image.</p>
<p>See also <a href="qclimage2d.html#bytesPerLine">bytesPerLine</a>().</p>
<!-- @@@bytesPerElement -->
<!-- $$$bytesPerLine[overload1]$$$bytesPerLine -->
<h3 class="fn"><a name="bytesPerLine"></a>int QCLImage2D::bytesPerLine () const</h3>
<p>Returns the number of bytes per line in this OpenCL image.</p>
<p>See also <a href="qclimage2d.html#bytesPerElement">bytesPerElement</a>().</p>
<!-- @@@bytesPerLine -->
<!-- $$$copyTo[overload1]$$$copyToconstQRect&constQCLImage2D&constQPoint& -->
<h3 class="fn"><a name="copyTo"></a>bool QCLImage2D::copyTo ( const QRect &amp; <i>rect</i>, const QCLImage2D &amp; <i>dest</i>, const QPoint &amp; <i>destOffset</i> )</h3>
<p>Copies the contents of <i>rect</i> from this image to <i>destOffset</i> in <i>dest</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#copyToAsync">copyToAsync</a>().</p>
<!-- @@@copyTo -->
<!-- $$$copyTo$$$copyToconstQRect&constQCLImage3D&constsize_t[3] -->
<h3 class="fn"><a name="copyTo-2"></a>bool QCLImage2D::copyTo ( const QRect &amp; <i>rect</i>, const <a href="qclimage3d.html">QCLImage3D</a> &amp; <i>dest</i>, const size_t[3] <i>destOffset</i> )</h3>
<p>Copies the contents of <i>rect</i> from this image to <i>destOffset</i> in <i>dest</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#copyToAsync">copyToAsync</a>().</p>
<!-- @@@copyTo -->
<!-- $$$copyTo$$$copyToconstQRect&constQCLBuffer&size_t -->
<h3 class="fn"><a name="copyTo-3"></a>bool QCLImage2D::copyTo ( const QRect &amp; <i>rect</i>, const <a href="qclbuffer.html">QCLBuffer</a> &amp; <i>dest</i>, size_t <i>destOffset</i> )</h3>
<p>Copies the contents of <i>rect</i> from this image to <i>destOffset</i> in <i>dest</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#copyToAsync">copyToAsync</a>().</p>
<!-- @@@copyTo -->
<!-- $$$copyToAsync[overload1]$$$copyToAsyncconstQRect&constQCLImage2D&constQPoint&constQCLEventList& -->
<h3 class="fn"><a name="copyToAsync"></a><a href="qclevent.html">QCLEvent</a> QCLImage2D::copyToAsync ( const QRect &amp; <i>rect</i>, const QCLImage2D &amp; <i>dest</i>, const QPoint &amp; <i>destOffset</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Requests that the contents of <i>rect</i> from this image be copied to <i>destOffset</i> in <i>dest</i>. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#copyTo">copyTo</a>().</p>
<!-- @@@copyToAsync -->
<!-- $$$copyToAsync$$$copyToAsyncconstQRect&constQCLImage3D&constsize_t[3]constQCLEventList& -->
<h3 class="fn"><a name="copyToAsync-2"></a><a href="qclevent.html">QCLEvent</a> QCLImage2D::copyToAsync ( const QRect &amp; <i>rect</i>, const <a href="qclimage3d.html">QCLImage3D</a> &amp; <i>dest</i>, const size_t[3] <i>destOffset</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Requests that the contents of <i>rect</i> from this image be copied to <i>destOffset</i> in <i>dest</i>. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#copyTo">copyTo</a>().</p>
<!-- @@@copyToAsync -->
<!-- $$$copyToAsync$$$copyToAsyncconstQRect&constQCLBuffer&size_tconstQCLEventList& -->
<h3 class="fn"><a name="copyToAsync-3"></a><a href="qclevent.html">QCLEvent</a> QCLImage2D::copyToAsync ( const QRect &amp; <i>rect</i>, const <a href="qclbuffer.html">QCLBuffer</a> &amp; <i>dest</i>, size_t <i>destOffset</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Requests that the contents of <i>rect</i> from this image be copied to <i>destOffset</i> in <i>dest</i>. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#copyTo">copyTo</a>().</p>
<!-- @@@copyToAsync -->
<!-- $$$drawImage[overload1]$$$drawImageQPainter*constQPoint&constQRect&Qt::ImageConversionFlags -->
<h3 class="fn"><a name="drawImage"></a>void QCLImage2D::drawImage ( QPainter * <i>painter</i>, const QPoint &amp; <i>point</i>, const QRect &amp; <i>subRect</i> = QRect(), Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</h3>
<p>Draws this 2D OpenCL image on <i>painter</i> at <i>point</i>.</p>
<p>If <i>subRect</i> is null, the entire image is drawn; otherwise only the indicated sub-rectangle of the image will be drawn.</p>
<p>If scaling is required to transform the image to the <i>painter</i>, then <i>flags</i> is used to specify how to transform colors during scaling.</p>
<p>This function is equivalent to calling QPainter::drawImage() on the result of <a href="qclimage2d.html#toQImage">toQImage</a>() but it may be implemented more efficiently by directly copying the OpenCL image data to the painting surface. If it isn't possible to optimize the draw, this function will be no worse than calling QPainter::drawImage() on the result of <a href="qclimage2d.html#toQImage">toQImage</a>().</p>
<!-- @@@drawImage -->
<!-- $$$drawImage$$$drawImageQPainter*constQRect&constQRect&Qt::ImageConversionFlags -->
<h3 class="fn"><a name="drawImage-2"></a>void QCLImage2D::drawImage ( QPainter * <i>painter</i>, const QRect &amp; <i>targetRect</i>, const QRect &amp; <i>subRect</i> = QRect(), Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor )</h3>
<p>Draws this 2D OpenCL image on <i>painter</i>, scaled to fit <i>targetRect</i>.</p>
<p>If <i>subRect</i> is null, the entire image is drawn; otherwise only the indicated sub-rectangle of the image will be drawn.</p>
<p>The <i>flags</i> are used to specify how to transform colors during scaling.</p>
<p>This function is equivalent to calling QPainter::drawImage() on the result of <a href="qclimage2d.html#toQImage">toQImage</a>() but it may be implemented more efficiently by directly copying the OpenCL image data to the painting surface. If it isn't possible to optimize the draw, this function will be no worse than calling QPainter::drawImage() on the result of <a href="qclimage2d.html#toQImage">toQImage</a>().</p>
<!-- @@@drawImage -->
<!-- $$$format[overload1]$$$format -->
<h3 class="fn"><a name="format"></a><a href="qclimageformat.html">QCLImageFormat</a> QCLImage2D::format () const</h3>
<p>Returns the format descriptor for this OpenCL image.</p>
<!-- @@@format -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn"><a name="height"></a>int QCLImage2D::height () const</h3>
<p>Returns the height of this OpenCL image.</p>
<p>See also <a href="qclimage2d.html#width">width</a>().</p>
<!-- @@@height -->
<!-- $$$map[overload1]$$$mapconstQRect&QCLMemoryObject::Accessint* -->
<h3 class="fn"><a name="map"></a>void * QCLImage2D::map ( const QRect &amp; <i>rect</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, int * <i>bytesPerLine</i> = 0 )</h3>
<p>Maps the image region <i>rect</i> into host memory for the specified <i>access</i> mode. Returns a pointer to the mapped region.</p>
<p>If <i>bytesPerLine</i> is not null, it will return the number of bytes per line in the mapped image.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#mapAsync">mapAsync</a>() and <a href="qclmemoryobject.html#unmap">unmap</a>().</p>
<!-- @@@map -->
<!-- $$$mapAsync[overload1]$$$mapAsyncvoid**constQRect&QCLMemoryObject::AccessconstQCLEventList&int* -->
<h3 class="fn"><a name="mapAsync"></a><a href="qclevent.html">QCLEvent</a> QCLImage2D::mapAsync ( void ** <i>ptr</i>, const QRect &amp; <i>rect</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList(), int * <i>bytesPerLine</i> = 0 )</h3>
<p>Maps the image region <i>rect</i> into host memory for the specified <i>access</i> mode. Returns a pointer to the mapped region in <i>ptr</i>, which will be valid only after the request finishes.</p>
<p>If <i>bytesPerLine</i> is not null, it will return the number of bytes per line in the mapped image.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#map">map</a>() and <a href="qclmemoryobject.html#unmapAsync">unmapAsync</a>().</p>
<!-- @@@mapAsync -->
<!-- $$$read[overload1]$$$readvoid*constQRect&int -->
<h3 class="fn"><a name="read"></a>bool QCLImage2D::read ( void * <i>data</i>, const QRect &amp; <i>rect</i>, int <i>bytesPerLine</i> = 0 )</h3>
<p>Reads the contents of <i>rect</i> from within this image into <i>data</i>. Returns true if the read was successful; false otherwise. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#readAsync">readAsync</a>(), <a href="qclimage2d.html#write">write</a>(), and <a href="qclimage2d.html#toQImage">toQImage</a>().</p>
<!-- @@@read -->
<!-- $$$read$$$readQImage*constQRect& -->
<h3 class="fn"><a name="read-2"></a>bool QCLImage2D::read ( QImage * <i>image</i>, const QRect &amp; <i>rect</i> = QRect() )</h3>
<p>This is an overloaded function.</p>
<p>Reads the contents of <i>rect</i> from within this 2D OpenCL image into <i>image</i>. Returns true if the read was successful; false otherwise. If <i>rect</i> is null, then the entire image is read.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<!-- @@@read -->
<!-- $$$readAsync[overload1]$$$readAsyncvoid*constQRect&constQCLEventList&int -->
<h3 class="fn"><a name="readAsync"></a><a href="qclevent.html">QCLEvent</a> QCLImage2D::readAsync ( void * <i>data</i>, const QRect &amp; <i>rect</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList(), int <i>bytesPerLine</i> = 0 )</h3>
<p>Reads the contents of <i>rect</i> from within this image into <i>data</i>. Returns true if the read was successful; false otherwise. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#read">read</a>() and <a href="qclimage2d.html#writeAsync">writeAsync</a>().</p>
<!-- @@@readAsync -->
<!-- $$$toQImage[overload1]$$$toQImagebool -->
<h3 class="fn"><a name="toQImage"></a>QImage QCLImage2D::toQImage ( bool <i>cached</i> = true )</h3>
<p>Reads the contents of this 2D OpenCL image and returns it as a QImage. Returns a null QImage if the OpenCL image's format cannot be converted into a QImage format.</p>
<p>If <i>cached</i> is true (the default), then this will allocate memory for a QImage object internally and return the same object each time. Otherwise a new QImage object will be created.</p>
<p>See also <a href="qclimage2d.html#read">read</a>() and <a href="qclimage2d.html#drawImage">drawImage</a>().</p>
<!-- @@@toQImage -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn"><a name="width"></a>int QCLImage2D::width () const</h3>
<p>Returns the width of this OpenCL image.</p>
<p>See also <a href="qclimage2d.html#height">height</a>() and <a href="qclimage2d.html#bytesPerLine">bytesPerLine</a>().</p>
<!-- @@@width -->
<!-- $$$write[overload1]$$$writeconstvoid*constQRect&int -->
<h3 class="fn"><a name="write"></a>bool QCLImage2D::write ( const void * <i>data</i>, const QRect &amp; <i>rect</i>, int <i>bytesPerLine</i> = 0 )</h3>
<p>Writes the contents <i>data</i> to <i>rect</i> within this image. Returns true if the write was successful; false otherwise. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#writeAsync">writeAsync</a>() and <a href="qclimage2d.html#read">read</a>().</p>
<!-- @@@write -->
<!-- $$$write$$$writeconstQImage&constQRect& -->
<h3 class="fn"><a name="write-2"></a>bool QCLImage2D::write ( const QImage &amp; <i>image</i>, const QRect &amp; <i>rect</i> = QRect() )</h3>
<p>This is an overloaded function.</p>
<p>Writes the contents of <i>image</i> to <i>rect</i> within this 2D OpenCL image. Returns true if the write was successful; false otherwise. If <i>rect</i> is null, then the entire image is read.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<!-- @@@write -->
<!-- $$$writeAsync[overload1]$$$writeAsyncconstvoid*constQRect&constQCLEventList&int -->
<h3 class="fn"><a name="writeAsync"></a><a href="qclevent.html">QCLEvent</a> QCLImage2D::writeAsync ( const void * <i>data</i>, const QRect &amp; <i>rect</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList(), int <i>bytesPerLine</i> = 0 )</h3>
<p>Writes the contents of <i>data</i> into <i>rect</i> within this image. Returns true if the write was successful; false otherwise. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclimage2d.html#write">write</a>() and <a href="qclimage2d.html#readAsync">readAsync</a>().</p>
<!-- @@@writeAsync -->
<!-- $$$operator=[overload1]$$$operator=constQCLImage2D& -->
<h3 class="fn"><a name="operator-eq"></a>QCLImage2D &amp; QCLImage2D::operator= ( const QCLImage2D &amp; <i>other</i> )</h3>
<p>Assigns <i>other</i> to this object.</p>
<!-- @@@operator= -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
